package com.wutianyi.example;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class CompanyServices {

	private CompanyMapper companyMapper;

	public CompanyDO getCompanyById(String id) {
		return companyMapper.getCompany(id);
	}

	public CompanyMapper getCompanyMapper() {
		return companyMapper;
	}

	public void setCompanyMapper(CompanyMapper companyMapper) {
		this.companyMapper = companyMapper;
	}

	public static void main(String[] args) {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
				"example/mybatis-spring-context.xml");
		CompanyServices companyServices = (CompanyServices) applicationContext
				.getBean("companyServices");
		CompanyDO company = companyServices.getCompanyById("1");
		System.out.println(company);
	}
}
